package someclass;

public class showBookList {
    public int[] bookId;
    public Book[] ownBook;
    public showBookList(){
        ownBook=new Book[5];
        ownBook[0]=new Book("Thinking in Java","Programming Language","Bruce Eckel","TP311.23",2);
        ownBook[1]=new Book("C++ Primer", "Programming Language","Stanley.B" ,"TP312.75",3);
        ownBook[2]=new Book("Data Structure","Others","YanWeimin","TP411.34",0);
        ownBook[3]=new Book("Test Driven Development","Programming Method","Kent Beck","TP421.96",2);
        ownBook[4]=new Book( "MySQL Database", "Database","YangXiaoyun","TP512.35",3);
        bookId = new int[]{0,1,2,3,4};
    }
    public String showTitle() {
        String title ="List Of All Books In The Library";
        String subtitle = "ID       Name        Author      Type        Location        Number";
        System.out.println(title);
        System.out.println(subtitle);
        return title;
    }
    public void showBookInfoList(){
        for(int i=0;i<ownBook.length;i++){
            String message=ownBook[i].getBookName()+" "+ownBook[i].getBookType()+" "+ownBook[i].getBookAuthor()+
                    " "+ownBook[i].getBootLocation()+" "+ownBook[i].getBookNumber();
            System.out.println(message);
        }
    }
}
